<!-- 转账汇款审核 -->
<template>
	<div >
	    <el-form :inline="true" :model="ruleForm" class="demo-form-inline">
	        <el-form-item label="项目名称：">
	            <el-input placeholder="请输入项目名称" v-model.trim="ruleForm.projectName" maxlength="20"></el-input>
	        </el-form-item>
	        <el-form-item label="姓名：">
	            <el-input placeholder="请输入姓名" v-model.trim="ruleForm.userName" maxlength="20"></el-input>
	        </el-form-item>

	        <el-form-item label="审核状态">
	          <el-select v-model="ruleForm.examineState">
	            <el-option v-for="item in auditstatelist" :label="item.label" :value="item.id" :key="item.id"></el-option>
	          </el-select>
	        </el-form-item>
	        <el-form-item>
	            <el-button type="primary" @click="searchList" id="monitorEnter">查询</el-button>
	         </el-form-item>
	    </el-form>
	
	    <el-table :data="tableData" border>
	        <el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
	        <el-table-column label="交易流水号" prop="pipelineNumber" align="center"></el-table-column>
	        <el-table-column label="跟投单号" prop="orderNumber"  align="center"></el-table-column>
	        <el-table-column label="项目名称" prop="projectName" align="center"></el-table-column>
	        <el-table-column label="姓名" prop="userName" align="center"></el-table-column>
	        <el-table-column label="实付金额（元）" prop="alreadyAmount" align="center" :formatter="initCash"></el-table-column>
	        <el-table-column label="汇款日期" prop="payTime" align="center">
<!-- 				<template slot-scope="scope">
					{{dateformathander(scope.row.payTime)}}
				</template> -->
	        </el-table-column>
	        <el-table-column label="银行卡号" prop="bankAccount" align="center" ></el-table-column>
	        <el-table-column label="开户行" prop="openingBank" align="center" ></el-table-column>
	        <el-table-column label="审核状态" prop="examineState" align="center">
	        	<template slot-scope="scope">
	        		{{initexaminestate(scope.row.examineState)}}
	        	</template>
	        </el-table-column>
	        <el-table-column label="提交人" prop="submitter" align="center"></el-table-column>
	        <el-table-column label="提交时间" prop="commitDate" align="center"></el-table-column>
	        <el-table-column label="操作" align="center">
	             <template slot-scope="scope">
	                <el-button type="text" :disabled="scope.row.examineState == 2 || scope.row.examineState == 3" @click="audithander('audit',scope.row)">审核</el-button>
	                <el-button type="text" @click="audithander('look',scope.row)">查看</el-button>
	             </template> 
	        </el-table-column>
	    </el-table>
	    <div class="pagebar">
	        <el-pagination
	                background
	                layout="total, sizes, prev, pager, next"
	                :current-page.sync="ruleForm.pageNum"
	                :page-sizes="[10, 20, 30, 40]"
	                :page-size="ruleForm.pageSize"
	                @size-change="handleSizeChange"
	                @current-change="handleCurrentChange"
	                :total="totalSize">
	        </el-pagination>
	    </div>
	</div>
</template>
<script>
	import api from '@/api/apiPath'
	export default {
		title:'转账汇款审核',
	    data() {
	        return {
	            ruleForm: {
	                projectName: undefined,
	                userName:undefined,
	                pageNum: 1,
	                pageSize: 10,
	                examineState:0,//支付状态
	            },
	            totalSize: 0,
	            tableData: [],
	            auditstatelist:[
		            {id: 0, label: '全部'},
		            {id: 1, label: '未审批'},
		            {id: 2, label: '审核通过'},
		            {id: 3, label: '审核不通过'},
	            ]
	        }
	    },
	    created() {
	        this.getlist()
	    },
	    activated(){
			this.searchList()
	    },
	    methods: {
	    	initCash(row, column, cellValue, index){
	    		if (!cellValue) return
	    	    if(cellValue !== 0){
	    	        return cellValue.toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");
	    	    }
	    	    if(cellValue == 0){
	    	        return "0.00"
	    	    }
	    	},
	    	initexaminestate(val){
	    		if (val == 1) {
	    			return '未审批'
	    		}else if(val == 2){
	    			return '审核通过'
	    		}else if(val == 3){
	    		    return '审核不通过'
	    		}
	    	},
	    	getlist(){
	    		this.axios.post(api.EXAMINELIST,this.ruleForm).then((res)=>{
	    			if (res.data.code == 200) {
	    				this.tableData = res.data.data.list
	    				this.totalSize = res.data.data.total
	    			}
	    		})
	    	},
	    	handleCurrentChange() {
	    	    this.getlist()
	    	},
	    	handleSizeChange(val) {
	    	    this.ruleForm.pageSize = val
	    	    this.getlist();
	    	},
	    	searchList(){
	    	    this.ruleForm.pageNum = 1
	    	    this.getlist()
	    	},
	    	audithander(type,val){
	    		this.$router.push({path:'/transferAuditDetails',query:{pageType:type,id:val.id}})
	    	}
	    }
	}

</script>

<style lang="stylus">

</style>